# -*- coding: utf-8 -*-

import unittest
from pprint import pprint
from product.kangmaProduct import KangmaProduct
from user.kangmaUser import KangmaUser
from util.utils import Utils


######################################
# 商品查询测试用例
######################################

class ProductSearchTestCase(unittest.TestCase):

    # 进行测试前的初始化工作
    def setUp(self):
        pprint('配置环境')
        # 先登录
        self.user = KangmaUser('supplierApp', '13865208627', '888888')
        # 获取供应商ID
        self.supplierId = Utils.getSupplierLoginId(self.user.loginUserInfo)

    # 清理环境
    def tearDown(self):
        pprint('清理环境')

    # 查询商品列表
    def test_productSearchList(self):
        product = KangmaProduct(self.user)
        # 商品管理-商品列表
        productListParm = {
            'supplierId': self.supplierId,
            'goodsSn': None,
            'name': None,
            'mnemonicCode': None,
            'categoryId': None,
            'brandId': None,
            'status': None,
            'isMarketable': None,
        }
        productListRes = product.getProductList(productListParm)
        pprint(productListRes)


if __name__ == '__main__':
    unittest.main()
